package com.ggshily.swf.tag;


public class SWFTagFactory
{
	public static ISWFTag getSWFTag(int type) throws InstantiationException, IllegalAccessException
	{
		ISWFTag tag = null;
		
		if(TAG_CLASSES.length > type && TAG_CLASSES[type] != null)
		{
			tag = (ISWFTag) TAG_CLASSES[type].newInstance();
		}
		
		if(tag == null)
		{
			System.out.println("type:" + type);
		}
		
		return tag;
	}

	public static final Class<?>[] TAG_CLASSES = 
	{
		SWFTag.class, //tagEnd = 0;
		SWFTag.class, //tagShowFrame = 1;
		SWFTag.class, //tagDefineShape = 2;
		SWFTag.class, //tagFreeCharacter =3;
		SWFTag.class, //tagPlaceObject = 4;
		SWFTag.class, //tagRemoveObject = 5;
		SWFTag.class, //tagDefineBits = 6;
		SWFTag.class, //tagDefineButton = 7;
		SWFTag.class, //tagJPEGTables = 8;
		SWFTag.class, //tagSetBackgroundColor = 9;
		SWFTag.class, //tagDefineFont = 10;
		SWFTag.class, //tagDefineText = 11;
		SWFTag.class, //tagDoAction = 12;
		SWFTag.class, //tagDefineFontInfo = 13;
		SWFTag.class, //tagDefineSound = 14;
		SWFTag.class, //tagStartSound = 15;
		SWFTag.class, //tagStopSound =16;
		SWFTag.class, //tagDefineButtonSound = 17;
		SWFTag.class, //tagSoundStreamHead = 18;
		SWFTag.class, //tagSoundStreamBlock = 19;
		SWFTag.class, //tagDefineBitsLossless = 20;
		SWFTag.class, //tagDefineBitsJPEG2 = 21;
		SWFTag.class, //tagDefineShape2 = 22;
		SWFTag.class, //tagDefineButtonCxform = 23;
		SWFTag.class, //tagProtect = 24;
		SWFTag.class, //tagPathsArePostScript = 25;
		SWFTag.class, //tagPlaceObject2 = 26;
		null,
		SWFTag.class, //tagRemoveObject2 = 28;
		null,
		null,
		null,
		SWFTag.class, //tagDefineShape3 = 32;
		SWFTag.class, //tagDefineText2 = 33;
		SWFTag.class, //tagDefineButton2 = 34;
		SWFTag.class, //tagDefineBitsJPEG3 = 35;
		SWFTag.class, //tagDefineBitsLossless2 = 36;
		SWFTag.class, //tagDefineEditText = 37;
		SWFTag.class, //tagDefineVideo = 38;
		SWFTag.class, //tagDefineSprite = 39;
		SWFTag.class, //tagNameCharacter = 40;
		SWFTag.class, //tagProductInfo = 41; // non officially
		null,
		SWFTag.class, //tagFrameLabel = 43;
		null,
		SWFTag.class, //tagSoundStreamHead2 = 45;
		SWFTag.class, //tagDefineMorphShape = 46;
		null,
		SWFTag.class, //tagDefineFont2 = 48;
		null,
		null,
		null,
		null,
		null,
		null,
		null,
		SWFTag.class, //tagExportAssets = 56;
		SWFTag.class, //tagImportAssets = 57;
		SWFTag.class, //tagEnableDebugger = 58;
		SWFTag.class, //tagDoInitAction = 59;
		SWFTag.class, //tagDefineVideoStream = 60;
		SWFTag.class, //tagVideoFrame = 61;
		SWFTag.class, //tagDefineFontInfo2 = 62;
		SWFTag.class, //tagExtDebuggerInfo = 63;
		SWFTag.class, //tagEnableDebugger2 = 64;
		SWFTag.class, //tagScriptLimits = 65;
		SWFTag.class, //tagSetTabIndex = 66;
		SWFTag.class, //tagDefineShape4 = 67; // use 83
		null,
		SWFTag.class, //tagFileAttributes = 69;
		SWFTag.class, //tagPlaceObject3 = 70;
		SWFTag.class, //tagImportAssets2 = 71;
		SWFTag.class, //tagDoABC = 72;
		SWFTag.class, //tagDefineFontAlignZones = 73;
		SWFTag.class, //tagCSMTextSettings = 74;
		SWFTag.class, //tagDefineFont3 = 75;
		SWFTagSymbolClass.class, //tagSymbolClass = 76;
		SWFTag.class, //tagMetadata = 77;
		SWFTag.class, //tagDefineScalingGrid = 78;
		null,
		null,
		null,
		SWFTagDoABC.class, //tagDoABC2 = 82;
		SWFTag.class, //tagDefineShape4 = 83;
		SWFTag.class, //tagDefineMorphShape2 = 84;
		null,
		SWFTag.class, //tagDefineSceneAndFrameLabelData = 86;
		SWFTag.class, //tagDefineBinaryData = 87;
		SWFTag.class, //tagDefineFontName = 88;
		SWFTag.class, //tagStartSound2 = 89;
		SWFTag.class, //tagDefineBitsJPEG4 = 90;
		SWFTag.class, //tagDefineFont4 = 91;
	};
}
